package com.leehom.arch.base.reportquery;

import java.util.Map;

import com.leehom.arch.base.reportquery.dynsql.DynSql;
import com.leehom.arch.common.Page;
import com.leehom.arch.common.SortBean;

/**
 * 类名: ReportQueryDao
 * 说明: 报表(动态)查询dao接口
 *
 * @author   leehom 
 * @Date	 Oct 19, 2009 1:55:09 PM
 * 
 *
 * @see 	 
 */
public interface ReportQuery {
	
	
	public DynSql dynSql(String name);
	
	/**
	 * @说明：执行sql，更新/删除
	 *
	 * @author leehom
	 * @param name
	 * @return
	 * 
	 */
	public int execSql(String sqlName, Map<String, Object> params);
	public int execJpql(String jpqlName, Map<String, Object> params);
	
	/**
	 * @说明：命名sql/hql报表查询，不分页
	 *
	 * @author leehom
	 * @param sqlName
	 * @param paramNames
	 * @param values
	 * @return
	 * 
	 */
	public Object queryNamedSQL(String sqlName, Map<String, Object> params, String resultKey);
	public Object queryNamedSQL(String sqlName, Map<String, Object> params);
	public Object queryNamedHQL(String hqlName, Map<String, Object> params);
	
	public Object queryNamedSQL(DynSql dynSql, Map<String, Object> params);
	public Object queryNamedSQL(DynSql dynSql, Map<String, Object> params, String resultKey);
	public Object queryNamedHQL(DynSql dynSql, Map<String, Object> params);
	
	/**
	 * @说明：命名sql/hql报表查询，分页
	 *
	 * @author leehom
	 * @param page
	 * @param queryString	
	 * @return
	 * 
	 */
	public Page pageQueryNamedSQL(Page page, String sqlName, Map<String, Object> params);
	public Page pageQueryNamedHQL(Page page, String sqlName, Map<String, Object> params);
	
	public Page pageQueryNamedSQL(Page page, String sqlName, DynSql dynSql, Map<String, Object> params);
	public Page pageQueryNamedHQL(Page page, DynSql dynSql, Map<String, Object> params);
	
	/**
	 * @说明：计算总数
	 *
	 * @author leehom
	 * @param sqlName
	 * @param params
	 * @return
	 * 
	 */
	public Long totalQuerySql(String sqlName, Map<String, Object> params);
	public Long totalQueryJpql(String sqlName, Map<String, Object> params);
	public Page PageQueryJpql(Page page, String jpqlName, Map<String, Object> params, SortBean sortBean);
}
